Value of Object number of a new object without Object header

Hello gr8 DXL developers,

I noticed when i create new object and don't fill its object header field,its object number is automatically derived from its parent and it appears in the hierarchy as if it has no object number
ex : 1.1 object with a header
1.1.0-1 insert new object below 1.1 and it is without object header attribute
this attitude occurs if i inserted the object manually in doors ,but if i made it by dxl the new object has different object number and it appears in the hierarchy with its numbering
1.1 object with header
1.1.1 insert new object below 1.1 and it is without object header attribute

So i need to make the same attitude occured by doors using DXL
Any help will be more than appreciated

Thanks in advance :)
DXL - Wed Sep 05 18:47:29 EDT 2012

Re: Value of Object number of a new object without Object header
SystemAdmin - Wed Sep 05 22:55:14 EDT 2012

The Object Number should only be displayed if there is text in the "Object Heading" attribute.

Are you sure that the text is in the correct attribute - it should be in the "Object Text" attribute and the "Object Heading" attribute should be empty.

Are you absolutely sure that the "Object Heading" attribute is empty and does not contain any hidden white space characters?

Is the displayed object number above the text like that shown below?
1.1.1
Text appears here below the Object Number

or is the displayed object number next to the text like that shown below?
1.1.1 Text appears here next to the Object Number

Can you tell us what version of DOORS your are using and also show your DXL code so that we can see where the problem might be?


Paul Miller,
Melbourne, Australia

Re: Value of Object number of a new object without Object header
DXL - Thu Sep 06 10:37:06 EDT 2012

Hi Paul,

I create an object and i want it to be Info so I don't want it to have Object number in the hierarchy

Here is my code :
void methodA(Object object){
object = create below current
object = current
ObjectTypeText = object.ObjectType
if( ObjectTypeText == "Info Obj"){
object.ObjectHeading = null
}
}
So i already overwrite any value in the object heading to ensure that it doesn't have an empty space.

About your question the first option is the one that I have

Thanks a million for your quick reply :)
Best Regards

Re: Value of Object number of a new object without Object header
DXL - Thu Sep 06 11:19:45 EDT 2012

Sorry it is the 2nd option
The displayed object number next to the text like that shown below:
1.1.1 Text appears here next to the Object Number

Re: Value of Object number of a new object without Object header
llandale - Thu Sep 06 17:06:47 EDT 2012

DXL - Thu Sep 06 10:37:06 EDT 2012
Hi Paul,

I create an object and i want it to be Info so I don't want it to have Object number in the hierarchy

Here is my code :
void methodA(Object object){
object = create below current
object = current
ObjectTypeText = object.ObjectType
if( ObjectTypeText == "Info Obj"){
object.ObjectHeading = null
}
}
So i already overwrite any value in the object heading to ensure that it doesn't have an empty space.

About your question the first option is the one that I have

Thanks a million for your quick reply :)
Best Regards

When you create a new object it will always appear to be a "heading" as far as the main "Object Heading and Text" column is conserned. Specifically, all "empty" objects (no heading/text/ole/picture) appear in that standard column AND the paragraph number's last field will look like ".n" and not like ".0-n" (like "3.1.1" not "3.1-0.1"). This is true whether you create the object "after" or "below", with the GUI or with DXL. Imported and pasted and copied objects not only get created but their attributes are usually populated, so the final object number may not follow these rules.

I find that feature rather perplexing. IMO, newly created empty objects should be Text (not heading) by default.

Anyway, newly created "empty" objects can be converted from Headings to Text by setting Object Text to something like a space. Erasing the Heading won't help since its already null.

As for your "methodA" function: let me slap you upside the head:

  • variable name "object" is asking for trouble since there are functions with that name.
  • you use variable "object" to refer to 3 different objects.
  • References to "current" object should be done only once if at all. Generally "oCurr = current" at the top of the script or the top of the callback; thereafter you deal with direct Object handles.
  • "object" is a call parameter, but you neither use its value as input nor return its value as output.
    • void methodA(Object &object){ may make more sense.
  • you seem to create a new object but lose it's handle, and tweak the Heading of the "current" object (above the newly created one) based on its ObjectType. That is two distinct activities, should be in two distinct functions, and in any event I think it to be a mistake.
  • I think you may prefer this:
Object methodA(Object oCurr){
    // Create a new object below oCurr.
    // When oCurr is an "Info Obj" then the new object should be a text object.
    Object oNew = create below oCurr
    string ObjectTypeText = oCurr.ObjectType
    if( ObjectTypeText == "Info Obj") then oNew."Object Text" = " "  // Display oNew as Text object
    return(oNew)
}
Object oPopulate = methodA(current Object)
oPopulate."MyRandomAttr" = "whatever"

 


Actually, I'd just go ahead and set the Text to a space every time.

-Louie

The following rules are not "perfect" but pretty good. An Object displays as a Text object (not a DOORS "Heading") when:

 

 

  • it is a table/row/cell object; or
  • raw Object Heading is null, and
    • raw Object Text is not null, or
    • rich Object Text contains an OLE, or
    • The object contains a "picture" (an antiquated residual notion from the stone age); or
  • some really obscure situation that I forgot.

Otherwise it displays as a DOORS Heading.

Note that table cells with valid "Object Heading" are still Text objects.

 

Re: Value of Object number of a new object without Object header
DXL - Sun Sep 09 04:10:53 EDT 2012

Hi ,
Thank you for ur reply but actually the method I wrote is just a part of a large file.
so I exctracted from it what i believed will clarify my question.
About making the "Object Text" empty ..well I don't want it empty..I need to write some description on it.
I want to have a new object with no Object Header and object Number (above.0-1) and have Object Text
So any other suggestion?
BTW I use doors 9.2

Best Regards

Re: Value of Object number of a new object without Object header
Mathias Mamsch - Mon Sep 10 04:00:54 EDT 2012

DXL - Sun Sep 09 04:10:53 EDT 2012
Hi ,
Thank you for ur reply but actually the method I wrote is just a part of a large file.
so I exctracted from it what i believed will clarify my question.
About making the "Object Text" empty ..well I don't want it empty..I need to write some description on it.
I want to have a new object with no Object Header and object Number (above.0-1) and have Object Text
So any other suggestion?
BTW I use doors 9.2

Best Regards

Well actually its pretty straightforward. It might be a problem with your code, since you are using the variables very weirdly:
 

// do not call a variable 'object' like the object perm. 
void methodA(Object object){
    // Use a NEW variable for the newly created object, do not overwrite the parameter
    object = create below current // why use current?? You might want to use 'object' here
 
    // Do you want to change object to be the OLD current object, i.e. the parent of the newly created object?
    object = current // This will so nothing, since the current Object will change to be the newly created object!
 
    ObjectTypeText = object.ObjectType // So: You are reading the text of the newly created object, which is empty!
    if( ObjectTypeText == "Info Obj") { // Therefore this will never be executed!
       object.ObjectHeading = null // It also does not make a lot of sense
    }
}

 


For you basic problem it boils down to this for normal DOORS objects (not table cells, *completely independent from DXL*):

 

 

  • When an object has neither object text or heading, you will see an heading number.
  • When an object has an object heading, you will always see a heading number
  • When an object has an empty heading and an object text you will see the heading number.


The heading number is always calculated by a fixed schema (which quickly becomes is non intuitive, as soon as you have a heading object below a text object), so there is no way to influence the given object number, except placing the object in the hierarchy. So if you place an object text object below Heading 1.1 it will ALWAYS have the object number 1.1.0-1 ... If you place a heading object there it will ALWAYS get the heading number 1.1.1. So if you do not want an Object Heading, that has two consequences:

 

 

 

  • The DOORS heading number ('attribute Object Number') WILL be 1.1.0-1.
  • DOORS will not show you the heading number in the main column, when your object has an object text.


So if you are asking to have an object below 1.1 without an Object Heading, with a Heading Number that is NOT 1.1.0-1, that is simply not possible. The only thing you can do is calculate your own heading number and put it to the object text (of course that will not update).

Hope that clears matters up, regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Value of Object number of a new object without Object header
DXL - Sun Sep 16 04:28:28 EDT 2012

When I wrote text in the Object Text Field and left the Object Header empty my problem was solved and the newly created object had number x.x-0.1
THANKS ALL FOR YOUR HELP